#include "Model.h"
#include "stlObject.h"
#include "GeometryManager.h"

Model::Model()
{
	position = glm::vec3(0,0,0);
	heading = glm::vec3(0,0,1);
	xAngle = yAngle = zAngle = 0;
	modelName = "box";
}

Model::Model( glm::vec3 pos, float xAng, float yAng, float zAng, std::string name )
{
	this->position = pos;
	this->xAngle = xAng;
	this->yAngle = yAng;
	this->zAngle = zAng;
	this->modelName = name;
}

void Model::loadFromSTL( const std::string& name )
{
	GeomData *geoDataPtr = GeometryManager::Instance()->getGeomData(name);
	if( geoDataPtr == 0x0 )
	{
		using TorLib::StlObject;
		StlObject *stlObj = new StlObject(name);

		GeometryManager::Instance()->CreateTriangleMesh(name, stlObj->_vertices, stlObj->_normals);


	}



}


